import Fetch from './base'
// import {
//   languagePacks,
//   SystemConfigConfigKeyGray,
//   ExternalHomepageHomePageData,
//   WebFeaturefilmListReq,
//   WebfeaturefilmList,
//   HomepageHottag,
//   WebJournalismList,
//   olympusTranslatorTextCacheReq,
//   olympusTranslatorTextCache,
//   WebJournalismOrgList,
//   WebDictDataTypeClassify,
//   HomepageSpecialarea,
//   WebDictDataTypeSection_type
// } from './mock'

const UrlMap = {
  LanguagePacksChinese:
    'https://cloudstorage.amsp.link/languagePacks/AMSP%E5%89%8D%E5%8F%B0_chinese.json',

  SystemConfigConfigKeyGray: 'https://api.amsp.link/amsp-api/external/system/config/configKey/gray',
  SystemConfigConfigKeyGray:
    'https://api.amsp.link/amsp-api/external/web/featurefilm/list?pageSize=100&pageNum=1&display=1&zipType=1',
  SystemConfigConfigKeyGray:
    'https://api.amsp.link/amsp-api/external/homepage/hottag?language=chinese',
  SystemConfigConfigKeyGray: 'https://api.amsp.link/amsp-api/external/homepage/homePageData',
  SystemConfigConfigKeyGray:
    'https://api.amsp.link/amsp-api/external/web/dict/data/type/section_type',
  SystemConfigConfigKeyGray: 'https://api.amsp.link/amsp-api/external/homepage/specialarea',
  SystemConfigConfigKeyGray: 'https://api.amsp.link/amsp-api/external/web/dict/data/type/classify',
  SystemConfigConfigKeyGray: 'https://api.amsp.link/amsp-api/external/web/journalism/orgList',

  SystemConfigConfigKeyGray: 'https://api.amsp.link/amsp-api/external/web/journalism/list',
  SystemConfigConfigKeyGray: 'https://api.amsp.link/amsp-api/external/olympus/translatorTextCache'
}

export const fetchClassify = () => {
  return Fetch({ url: 'amsp-api/external/web/dict/data/type/classify', method: 'GET' })
}

export const fetchLanguagePacks = (language: string = 'chinese') => {
  return Fetch({
    url: `languagePacks/AMSP%E5%89%8D%E5%8F%B0_${language}.json`,
    method: 'GET',
    needData: false
  })
}

export const fetchHomeData = () => {
  return Fetch({ url: 'amsp-api/external/web/dict/data/homeData', method: 'GET' })
}

// https://amsplink.usemock.com/amsp-api/external/web/journalism/journalismDetail/:id
export const fetchDetail = (id: string) => {
  return Fetch({ url: `amsp-api/external/web/journalism/journalismDetail/${id}`, method: 'GET' })
}
